package priv.stones.common.utils;

import java.util.HashMap;

/**
 * @Author: Stones
 * @Description:
 * @Date: 2017/10/10 17:10
 */
public class Result extends HashMap<String, Object> {

    public static Result Export(int code, String msg) {
        Result r = new Result();
        r.put("code", code);
        r.put("msg", msg);
        return r;
    }

    public static Result Error() {
        return Export(500, "操作失败");
    }

    public static Result Error(String msg) {
        return Export(500, msg);
    }

    public static Result Ok() {
        return Export(200, "操作成功");
    }

    public static Result Ok(String msg) {
        return Export(200, msg);
    }

}
